<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>

<%@ include file="../general/header.jsp" %>

	<div id="header">${title}</div>
	<%@ include file="../general/menu.jsp" %>
		<div id="content">
		<form:form method="POST" action="../item/purchaseItem" commandName="purchaseForm">

			<input type="hidden" id="id" name="itemId" value="${itemId}" >
			
			<span>Amount: </span>
				<form:select path="count">
					<c:forEach var="item" items="${list}">
						<option value="${item}">${item}</option>
					</c:forEach>
				</form:select>
			<form:errors path="count" />
			
			<span>Comment (optional): </span>
			<form:input  path="comment" /><br />
			<form:errors path="comment" />

			<input type="submit" value="Buy!" />
		</form:form>
	</div>
	<div id="bottom">
		<span class="inline spaced">
			<a class="color" href="../general/index">Go back to index</a>
		</span>
	</div>
	<%@ include file="../general/footer.jsp" %>